/*
*Author 		Gina Maya Purnama
*DateCreated	5 April 2011
*DateModified	6 April
*Version		1.1
*/

package jtk.project4.fleet.field;

import nl.coderight.jazz.form.FormLayout;
import nl.coderight.jazz.form.FormLayout.Resize;
import nl.coderight.jazz.form.control.CalendarControl;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.ComboField;
import nl.coderight.jazz.form.field.NumberField;
import nl.coderight.jazz.form.field.SelectField;
import nl.coderight.jazz.form.field.TextField;

public class AccidentLocationField extends GroupControl{
	private TextField addressField;
	private TextField cityField;
	private TextField stateProvinceField;
	private TextField postalCodeField;
	private TextField countryField;
	
	public AccidentLocationField(String bindID){
		setTitle("Accident Location");
		setBindID(bindID);
		createFields();
		createLayout();
	}

	private void createFields() {
		// TODO Auto-generated method stub
		addressField = new TextField("address", 15);
		addressField.setRequired(true);
		
		cityField = new TextField("city", 15);
		cityField.setRequired(true);		
		
		stateProvinceField = new TextField("stateProvince", 15);
		stateProvinceField.setRequired(true);
		
		postalCodeField = new TextField("postalCode", 15);
		postalCodeField.setRequired(true);
		
		countryField = new TextField("country", 15);
		countryField.setRequired(true);
	}
	
	private void createLayout() {
		// TODO Auto-generated method stub
		setLayout(new FormLayout())

		.addLabel("label.address")		.addField(addressField)
		.addRow()
		.addLabel("label.city")			.addField(cityField)
		.addRow()
		.addLabel("label.stateProvince").addField(stateProvinceField)
		.addRow()
		.addLabel("label.postalCode")	.addField(postalCodeField)
		.addRow()
		.addLabel("label.country")		.addField(countryField)
		;	
	}
	
}
